//
//  JMAsset.h
//  ImagePicker
//
//  Created by Jamin on 2018/10/15.
//  Copyright © 2018 jamin. All rights reserved.
//

#import <Foundation/Foundation.h>
@import Photos;
@class PHAsset;
typedef NS_ENUM(NSInteger, JMAssetMediaType) {
    JMAssetMediaTypeUnknown = 0,
    JMAssetMediaTypeImage   = 1,
    JMAssetMediaTypeVideo   = 2,
    JMAssetMediaTypeAudio   = 3,
};

typedef NS_ENUM(NSInteger, JMAssetMediaSubType) {
    JMAssetMediaSubTypeNone               = 0,
    
    // Photo subtypes
    JMAssetMediaSubTypePhotoPanorama      = (1UL << 0),
    JMAssetMediaSubTypePhotoHDR           = (1UL << 1),
    JMAssetMediaSubTypePhotoScreenshot  PHOTOS_AVAILABLE_IOS_TVOS(9_0, 10_0) = (1UL << 2),
    JMAssetMediaSubTypePhotoLive        PHOTOS_AVAILABLE_IOS_TVOS(9_1, 10_0) = (1UL << 3),
    JMAssetMediaSubTypePhotoDepthEffect PHOTOS_AVAILABLE_IOS_TVOS(10_2, 10_1) = (1UL << 4),
    
    // Video subtypes
    JMAssetMediaSubTypeVideoStreamed      = (1UL << 16),
    JMAssetMediaSubTypeVideoHighFrameRate = (1UL << 17),
    JMAssetMediaSubTypeVideoTimelapse     = (1UL << 18),
};


@interface JMIPAsset : NSObject

@property (nonatomic, strong) PHAsset *asset;
@property (nonatomic, readonly) JMAssetMediaType type;
@property (nonatomic, readonly) JMAssetMediaSubType subtypes;


+ (instancetype)assetWithAsset:(PHAsset *)asset;
//+ (instancetype)assetWithAsset:(PHAsset *)asset allowVideo:(BOOL)allowVideo

@end
